package entity;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public class Goods {
    private String gid ;
    private String gname ;
    private Double price ;
    private String  type ;
    private String gPicture ;
    private Integer stock ;
    private Integer saleVolume ;

    public Goods(String gid, String gname, Double price, String type, String gPicture, Integer stock, Integer saleVolume) {
        this.gid = gid;
        this.gname = gname;
        this.price = price;
        this.type = type;
        this.gPicture = gPicture;
        this.stock = stock;
        this.saleVolume = saleVolume;
    }
    public Goods() {

    }

    public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getGname() {
        return gname;
    }

    public void setGname(String gname) {
        this.gname = gname;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getgPicture() {
        return gPicture;
    }

    public void setgPicture(String gPicture) {
        this.gPicture = gPicture;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getSaleVolume() {
        return saleVolume;
    }

    public void setSaleVolume(Integer saleVolume) {
        this.saleVolume = saleVolume;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) {
            return false ;
        }else{
            Goods g = (Goods) o ;
            if(this.gid.equals(g.gid)){
                return true ;
            }
        }
        return false ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(gid);
    }
}
